Skip to content

feat: add "Roo Code: Open in This Tab" command #7051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Aug 13, 2025

This PR adds a new command "Roo Code: Open in This Tab" that opens Roo Code in the current tab instead of creating a new one.

Summary

  • Added new command roo-cline.openInThisTab to package.json
  • Implemented openClineInThisTab function that opens in the current active editor column
  • Added command ID to types and localization strings
  • The command reuses the active editor's view column, avoiding the need to close an empty tab

Related Issue

Closes #5457

Testing

  • TypeScript compilation passes ✅
  • ESLint checks pass ✅
  • All existing tests remain unaffected ✅

How it works

The new command opens Roo Code in the current active editor column (or Column One if no editor is active), while the existing "Open in New Tab" command continues to open in a new column to the right.

This provides users with the flexibility to choose whether they want to replace the current tab or open in a new one, addressing the issue where users had to close an empty tab after using "Open in New Tab".


Important

Adds roo-cline.openInThisTab command to open Roo Code in the current tab, enhancing user flexibility.

  • Behavior:
    • Adds roo-cline.openInThisTab command to package.json for opening Roo Code in the current tab.
    • Implements openClineInThisTab in registerCommands.ts to open Roo Code in the active editor column.
    • Command reuses active editor's view column, preventing empty tabs.
  • Localization:
    • Adds localization string for openInThisTab in package.nls.json.
  • Testing:
    • TypeScript compilation and ESLint checks pass.
    • All existing tests remain unaffected.
  • Misc:

This description was created by Ellipsis for 6c6df2f. You can customize this summary. It will automatically update as commits are pushed.

- Add new command openInThisTab to package.json
- Implement openClineInThisTab function that opens in current tab
- Add command to types and localization
- Closes #5457
@roomote roomote bot requested review from mrubens, cte and jr as code owners August 13, 2025 17:19
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Aug 13, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed my own code and found it acceptable. The bar was low.

@@ -39,6 +39,7 @@ export const commandIds = [
"settingsButtonClicked",

"openInNewTab",
"openInThisTab",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition to the command IDs list. The placement is logical, right after the related 'openInNewTab' command.

@@ -129,6 +129,7 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
return openClineInNewTab({ context, outputChannel })
},
openInNewTab: () => openClineInNewTab({ context, outputChannel }),
openInThisTab: () => openClineInThisTab({ context, outputChannel }),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command registration looks good, following the same pattern as openInNewTab.

@@ -298,3 +299,68 @@

return tabProvider
}

export const openClineInThisTab = async ({ context, outputChannel }: Omit<RegisterCommandOptions, "provider">) => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice there's significant code duplication between this new function and openClineInNewTab above. About 90% of the code is identical. Could we refactor these into a shared helper function that accepts parameters for the differences (view column selection and editor group locking)?

Also, is it intentional that this function doesn't lock the editor group like openClineInNewTab does? Without the lock, clicking on files might open them over the Roo Code panel.

@@ -115,6 +115,11 @@
"title": "%command.openInNewTab.title%",
"category": "%configuration.title%"
},
{
"command": "roo-cline.openInThisTab",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command definition looks good and follows the existing pattern.

@@ -15,6 +15,7 @@
"command.settings.title": "Settings",
"command.documentation.title": "Documentation",
"command.openInNewTab.title": "Open In New Tab",
"command.openInThisTab.title": "Open In This Tab",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English localization added correctly. Should we also update the other language files in the locales directory (zh-CN, ja, etc.) with translations for this new command title?

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Aug 13, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Aug 15, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Aug 15, 2025
…enClineInThisTab

- Extract common initialization logic to initializeClineTabProvider()
- Extract common panel setup to setupClinePanel()
- Both functions now share ~95% of their code through these helpers
- Reduces maintenance burden and ensures consistency
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Aug 15, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Aug 15, 2025
Copy link
Collaborator

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 15, 2025
@mrubens
Copy link
Collaborator

mrubens commented Aug 16, 2025

@roomote-agent can you switch into translate mode and add translations for the new string in all supported languages?

Copy link
Author

roomote bot commented Aug 16, 2025

Hi @mrubens! I see your request to add translations for the new "Open In This Tab" command string. I'll switch to translate mode and add the translations for all supported languages. Working on it now!

Added translations for the new "Open In This Tab" command string to all supported languages:
- Catalan (ca)
- German (de)
- Spanish (es)
- French (fr)
- Hindi (hi)
- Indonesian (id)
- Italian (it)
- Japanese (ja)
- Korean (ko)
- Dutch (nl)
- Polish (pl)
- Portuguese Brazil (pt-BR)
- Russian (ru)
- Turkish (tr)
- Vietnamese (vi)
- Simplified Chinese (zh-CN)
- Traditional Chinese (zh-TW)
Copy link
Author

roomote bot commented Aug 16, 2025

Hi @mrubens! ✅ I've successfully added translations for the "Open In This Tab" command to all 17 supported languages:

Translations added:

  • 🇪🇸 Catalan (ca): "Obrir en Aquesta Pestanya"
  • 🇩🇪 German (de): "In Diesem Tab Öffnen"
  • 🇪🇸 Spanish (es): "Abrir en Esta Pestaña"
  • 🇫🇷 French (fr): "Ouvrir dans Cet Onglet"
  • 🇮🇳 Hindi (hi): "इस टैब में खोलें"
  • 🇮🇩 Indonesian (id): "Buka di Tab Ini"
  • 🇮🇹 Italian (it): "Apri in Questa Scheda"
  • 🇯🇵 Japanese (ja): "このタブで開く"
  • 🇰🇷 Korean (ko): "이 탭에서 열기"
  • 🇳🇱 Dutch (nl): "Openen in Dit Tabblad"
  • 🇵🇱 Polish (pl): "Otwórz w Tej Karcie"
  • 🇧🇷 Portuguese Brazil (pt-BR): "Abrir Nesta Aba"
  • 🇷🇺 Russian (ru): "Открыть в этой вкладке"
  • 🇹🇷 Turkish (tr): "Bu Sekmede Aç"
  • 🇻🇳 Vietnamese (vi): "Mở trong Tab Này"
  • 🇨🇳 Simplified Chinese (zh-CN): "在此标签页中打开"
  • 🇹🇼 Traditional Chinese (zh-TW): "在此分頁中開啟"

Validation:

  • ✅ All translations validated with find-missing-translations.js script
  • ✅ The check-translations CI check has passed

The translations maintain consistency with the existing "Open In New Tab" translations and follow the localization guidelines for each language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: PR [Needs Review]
Development

Successfully merging this pull request may close these issues.

Add command 'Roo Code: Open in This Tab' (very simple)
4 participants